package com.example.covid.service;

import com.example.covid.Vo.InfQuery;
import com.example.covid.dao.InfectedPersonInformationMapper;
import com.example.covid.pojo.Area;
import com.example.covid.pojo.InfectedPersonInformation;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author KamenRider
 */
@Service("InfectedPersonInformationService")
@Transactional
public class InfectedPersonInformationServiceImpl implements InfectedPersonInformationService {

    @Resource
    private InfectedPersonInformationMapper infectedMapper;


    /**
     * 全查和模糊查询
     * @return
     */
    @Override
    public List<InfectedPersonInformation> getAllInfo(InfQuery infQuery) {
        return infectedMapper.getAllInfo(infQuery);
    }

    /**
     * 获取全部区域名称
     * @return
     */
    @Override
    public List<Area> getAllAreaName() {
        return infectedMapper.getAllAreaName();
    }

    /**
     * 获取总数据量
     * @param infQuery
     * @return
     */
    @Override
    public Long countInfList(InfQuery infQuery) {
        return infectedMapper.countInfList(infQuery);
    }
    /**
     *  添加疫情信息
     *  @param information */
    @Override
    public void addInf(InfectedPersonInformation information) {
        infectedMapper.addInf(information);
    }
    /**
     * 删除
     * @param ids
     */
    @Override
    public void deleteInfByIds(String ids) {
        infectedMapper.deleteInfByIds(ids);
    }

    /**
     * 根据id获取数据
     * @param id
     * @return
     */
    @Override
    public InfectedPersonInformation getInfById(Integer id) {
        return infectedMapper.getInfById(id);
    }
    /**
     * 修改数据
     * @param information
     */
    @Override
    public void updateInf(InfectedPersonInformation information) {
        infectedMapper.updateInf(information);
    }
}
